package com.beney.common;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * 存储文件的常用信息
 *
 * @author Beney
 */
public class StorageInfo {
    private StorageInfo() {
    }

    /**
     * 所有用户试卷存放目录
     */
    public static final String PAPERS_DIR = "src/storage/userPapers";

    /**
     * 用户信息存放的目录
     */
    public static final String USER_DIR = "src/storage/users";

    /**
     * 试卷存放的文件类型（后缀）
     */
    public static final String PAPER_TYPE = ".txt";

    private static final SimpleDateFormat SDF = new SimpleDateFormat();

    public static final char QID_DEC = '】';

    static {
        SDF.applyPattern("yyyy-MM-dd-HH-mm-ss");
    }

    public static String CreatePaperName() {
        return SDF.format(new Date()) + PAPER_TYPE;
    }

    public static String GetQuestionId(int id) {
        return String.valueOf(id) + QID_DEC;
    }
}
